import request from '@/common/request'

// 新建采集
export function addstations (data) {
  return request({
    url: '/api/device/add',
    method: 'post',
    data
  })
}
// 删除采集
export function removestations (value) {
  return request({
    url: '/api/device/del/' + value,
    method: 'post'
  })
}

// 修改采集
export function updatestations (data) {
  return request({
    url: '/api/device/edit',
    method: 'post',
    data
  })
}

// 获取全部采集
export function getstationsall (data) {
  return request({
    url: '/api/device/all',
    method: 'post',
    data
  })
}

// 采集站ID执行文件
export function zhixingid (value, file) {
  return request({
    url: '/api/device/exec/' + value,
    method: 'post',
    data: file
  })
}

// 批量执行文件
export function zhixinBatch (file) {
  return request({
    url: '/api/device/batch/exec',
    method: 'post',
    data: file
  })
}
// 下载模版
export function exportDefault () {
  return request({
    url: '/api/device/exportDefault',
    method: 'post',
    responseType: 'blob'
  })
}
// 获取执行历史
export function zhixinglishi (value) {
  return request({
    url: '/api/device/history/' + value,
    method: 'get'
  })
}

export function caijizhanpeizhi (value) {
  return request({
    url: '/api/device/config/' + value,
    method: 'get'
  })
}

// 获取单个采集
export function getstations (value) {
  return request({
    url: '/api/stations/get/' + value,
    method: 'get'
  })
}

// 获取全部设备
export function getevall (query) {
  return request({
    url: '/api/dev/map/all',
    method: 'get',
    params: query
  })
}

// 获取全部检测点
export function getdianall (shebeiid, cedianleixing) {
  return request({
    url: '/api/dian/byDev/' + shebeiid + '/' + cedianleixing,
    method: 'get'
  })
}
